module LineSplitterView where

import Graphics.UI.Gtk
import Control.Monad
import Control.Applicative

data ViewState = V 
    {
       mainWidget :: Widget
      , disableRB :: RadioButton
      , submatchModeRB :: RadioButton
      , linesplitModeRB :: RadioButton
    }

new :: Widget -> IO ViewState
new rw = do
  vbox <- vBoxNew False 2
  hbox <- vBoxNew False 2
  
  boxPackStart vbox hbox PackNatural 2
  boxPackEnd vbox rw PackGrow 2

  dis <- radioButtonNewWithLabel "Disabled"
  linesplit <- radioButtonNewWithLabelFromWidget dis "Field Seperation"
  submatch <- radioButtonNewWithLabelFromWidget dis "Use Submatches"

  linesplit `toggleButtonSetActive` False
  submatch `toggleButtonSetActive` False
  dis `toggleButtonSetActive` True

  boxPackStart hbox dis PackNatural 2
  boxPackStart hbox linesplit PackNatural 2
  boxPackStart hbox submatch PackNatural 2

  return $ V (toWidget vbox) dis submatch linesplit

  

  
